<template>
	<el-breadcrumb class="breadcrumb" separator="/" style="height: 45px;
    line-height: 45px;
    padding-left: 15px;">
        <el-breadcrumb-item><img src="../../assets/weizhi.png"/>{{$t("commons.location")}} :</el-breadcrumb-item>
        <el-breadcrumb-item 
            v-for='(name,index) in matchedArr'
            :key='index'
            >
            {{ $t(`commons.${name}`)}}
        </el-breadcrumb-item>
    </el-breadcrumb> 
</template>
<script>
export default {
    data() {
        return {
        };
    },
    computed:{
        matchedArr(){
            let temp = [],temps = [];
            this.$route.matched.filter((item,index,self) => {
                // if(item.meta.title){
                //     const title = item.meta.title;
                //     temp.push(title);
                // }
                if(item.name){
                    const name = item.name;
                    temp.push(name);
                }
            });
            temp.filter((item,index,self) => {
                if(!temps.includes(item)){
                    temps.push(item);
                }
            })
            return temps;
        }
    }
};
</script>
